﻿using Swimj.CommonLib.Attributes;
using Swimj.CommonLib.Controls;

namespace Admin.CommonLib.Models.User
{
    public class UserSearchRequestDto
    {
        [TextFieldColumn(DisplayText = "用户名")]
        public string? UserName { get; set; }

        [TextFieldColumn(DisplayText = "邮箱")]
        public string? Email { get; set; }

        [TextFieldColumn(DisplayText = "联系电话")]
        public string? Phone { get; set; }

        [SelectColumn(DisplayText = "数据状态", SelectDataSource = typeof(DataStateDataSource))]
        public int? DataState { get; set; }

        public string? Sort { get; set; }

        public string? Order { get; set; }

        public int Page { get; set; }

        public int Limit { get; set; }
    }

    public class DataStateDataSource : ISelectDataSource
    {
        public IDictionary<object, string> CreateDataSource()
        {
            return new Dictionary<object, string>()
            {
                { 1, "Enabled" },
                { 2, "Disabled" }
            };
        }
    }
}